﻿using System.Collections.Generic;

namespace CSBackup_Web.Sources.Override
{
    public class BackupInfo
    {
        //类域字符串常量，对应原C++类中的宏定义
        public static readonly string BACKUP_FULL_FOLDER_NAME = @"bak";
        public static readonly string BACKUP_DIF_FOLDER_NAME = @"dif";
        public static readonly string BACKUP_TYPE_FULL = @"Full";
        public static readonly string BACKUP_TYPE_INC = @"Inc";
        public static readonly string BACKUP_TYPE_DIF = @"Dif";
        public static readonly string BACKUP_TYPE_DIFINC = @"Difinc";
        public static readonly string BACKUP_TYPE_FULL_DISPLAY = @"全备份";
        public static readonly string BACKUP_TYPE_INC_DISPLAY = @"增量备份";
        public static readonly string BACKUP_TYPE_DIF_DISPLAY = @"差分备份";
        public static readonly string BACKUP_TYPE_DIFINC_DISPLAY = @"差分增量备份";
        public static readonly string BACKUP_UNIT_FILE = @"File";
        public static readonly string BACKUP_UNIT_DATA = @"Data";
        public static readonly string BACKUP_UNIT_FILE_DISPLAY = @"文件粒度";
        public static readonly string BACKUP_UNIT_DATA_DISPLAY = @"数据块粒度";
        public static readonly string POSTFIX_DIF_FILE = @".dif";
        public static readonly string POSTFIX_IDX_FILE = @".ndx";
        public static readonly string DEL_LIST_FILE_NAME = @"DelList.txt";
        public static readonly string BACKUP_CONFIG_FILE_NAME = @"BackupListRecord.xml";
        public static readonly string BACKUP_TMP_FILE_NAME = @"BackupTempFile.tmp";

        private string bkpName = string.Empty;
        private string bkpType = string.Empty;
        private string bkpLocation = string.Empty;
        private string bkpTime = string.Empty;
        private string bkpFileAmount = "0";
        private string bkpFileSize = "0";
        private string bkpDepended = string.Empty;
        private string bkpUnit = string.Empty;
        private bool selfSep = false;
        private bool retainSecAttribute = false;

        private List<string> fileList = new List<string>();

        public string BkpName
        {
            get { return bkpName; }
            set { bkpName = value; }
        }

        public string BkpType
        {
            get { return bkpType; }
            set { bkpType = value; }
        }

        public string BkpLocation
        {
            get { return bkpLocation; }
            set { bkpLocation = value; }
        }

        public string BkpTime
        {
            get { return bkpTime; }
            set { bkpTime = value; }
        }

        public string BkpFileAmount
        {
            get { return bkpFileAmount; }
            set { bkpFileAmount = value; }
        }

        public string BkpFileSize
        {
            get { return bkpFileSize; }
            set { bkpFileSize = value; }
        }

        public string BkpDepended
        {
            get { return bkpDepended; }
            set { bkpDepended = value; }
        }

        public string BkpUnit
        {
            get { return bkpUnit; }
            set { bkpUnit = value; }
        }

        public bool SelfSep
        {
            get { return selfSep; }
            set { selfSep = value; }
        }

        public bool RetainSecAttribute
        {
            get { return retainSecAttribute; }
            set { retainSecAttribute = value; }
        }

        public List<string> FileList
        {
            set { fileList = value; }
            get { return fileList; }
        }

        public void Init()
        {
            bkpName = string.Empty;
            bkpType = BACKUP_TYPE_FULL;
            bkpLocation = string.Empty;
            bkpTime = string.Empty;
            bkpFileAmount = string.Empty;
            bkpFileSize = string.Empty;
            bkpDepended = string.Empty;
            bkpUnit = BACKUP_UNIT_DATA;
            selfSep = false;
            retainSecAttribute = false;
            fileList.Clear();

            return;
        }
    }
}
